package cn.bdqn.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileUtil {

    public static void writeBytes(byte[] publicKeyBytes, String path) throws IOException {
        File file=new File(path);
        if(!file.exists()){
            try {
                file.createNewFile();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        try(FileOutputStream outputStream=new FileOutputStream(file)){
            outputStream.write(publicKeyBytes);
        }
    }
}
